/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gruppe1projekt.TUILayer;

import gruppe1projekt.ModelLayer.Product;
import gruppe1projekt.ModelLayer.SaleContainer;
import java.util.ArrayList;

/**
 *
 * @author Moulde
 */
public class RecursiveTest
{
    public RecursiveTest()
    {
        SaleContainer container = SaleContainer.getInstance();

        System.out.println("Recirsive testing");
        System.out.println("------------------------------");

        Product product1 = new Product();
        product1.setName("Produckt1");

        Product product2 = new Product();
        product2.setName("Produckt2");

        Product product3 = new Product();
        product3.setName("Produckt3");

        Product product4 = new Product();
        product4.setName("Produckt4");

        Product product5 = new Product();
        product5.setName("Produckt5");

        product1.addSubProduct(product2);
        product2.addSubProduct(product3);
        product3.addSubProduct(product4);

        ArrayList<Product> products = container.simpleResolveProducts(product1);

        for (Product product : products)
        {
            System.out.println(product.getName());
        }
    }
}
